package com.openlogic.common.core.expression;

/**
 * @ClassName: Element
 * @Description: 表达式分解元素
 * @author weiyongpeng
 * @date 2025年2月3日 下午1:35:46
 */
public class Element {

	public enum ElementType {
		STRING, NUMBER, BOOLEAN, DATACOLUMN, SPECIALPARAM, OPERATOR, SPLITOR, FUNCTION, SEPARATOR, TARGET, SPACE,
		NOANALYZE

	}

	/**
	 * 内容
	 */
	private String text;

	/**
	 * 元素类型
	 */
	private ElementType type;

	/**
	 * 在表达式中的开始位置
	 */
	private int startIndex = 0;

	public Element(String text, ElementType type, int startIndex) {
		super();
		this.text = text;
		this.type = type;
		this.startIndex = startIndex;
	}

	/**
	 * 获取text的值
	 */
	public String getText() {
		return text;
	}

	/**
	 * 设置text的值
	 */
	public void setText(String text) {
		this.text = text;
	}

	/**
	 * 获取type的值
	 */
	public ElementType getType() {
		return type;
	}

	/**
	 * 设置type的值
	 */
	public void setType(ElementType type) {
		this.type = type;
	}

	/**
	 * 获取startIndex的值
	 */
	public int getStartIndex() {
		return startIndex;
	}

	/**
	 * 设置startIndex的值
	 */
	public void setStartIndex(int startIndex) {
		this.startIndex = startIndex;
	}

	@Override
	public String toString() {
		return text;
	}

}
